xend: Auto-balloon a couple megabytes before creating an HVM domain as
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 27 Apr 2007 14:22:34 +0000 (15:22 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 27 Apr 2007 14:22:34 +0000 (15:22 +0100)
Xen will allocate 1MB for shadow memory immediately.
Suggested by Daniel Berrange.
Signed-off-by: Keir Fraser <keir@xensource.com>
tools/python/xen/xend/XendDomainInfo.py

index ecca07a3559698b44d0011aac7e22d0f961533df..4dc288314c6f1ee2e8c22c8797854741529e6aac 100644 (file)
@@ -1419,6 +1419,9 @@ class XendDomainInfo:
                 raise VmError("HVM guest support is unavailable: is VT/AMD-V "
                               "supported by your CPU and enabled in your "
                               "BIOS?")
+            # Hack to pre-reserve some memory for HVM setup.
+            # Needed because Xen allocates 1MB by default immediately.
+            balloon.free(2*1024) # 2MB should be plenty
 
         self.domid = xc.domain_create(
             domid = 0,